package db.pojo;

import java.util.*;
import java.text.SimpleDateFormat;
import db.ext.Ea_demo_fcfExt;
@SuppressWarnings("unchecked")
/**
 * ea_demo_fcf
 */
public class Ea_demo_fcf {
	/**
	 * FCFID
	 */
	public int fCFID;
	/**
	 * NAME
	 */
	public String nAME;
	/**
	 * VALUE
	 */
	public String vALUE;
	/**
	 * COLOR
	 */
	public String cOLOR;
	/**
	 * ALPHA
	 */
	public String aLPHA;
	/**
	 * ISSLICED
	 */
	public String iSSLICED;
	/**
	 * PRODUCT
	 */
	public String pRODUCT;
	SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static Ea_demo_fcfExt DB = new Ea_demo_fcfExt(); 
	
	public Ea_demo_fcf() {
		super();
	}
	
	public Ea_demo_fcf(int fCFID, String nAME, String vALUE, String cOLOR, String aLPHA, String iSSLICED, String pRODUCT) {
		super();
		this.fCFID = fCFID; 
		this.nAME = nAME; 
		this.vALUE = vALUE; 
		this.cOLOR = cOLOR; 
		this.aLPHA = aLPHA; 
		this.iSSLICED = iSSLICED; 
		this.pRODUCT = pRODUCT; 
	}
	
	public int getFCFID() {
		return fCFID;
	}

	public void setFCFID(int fCFID) {
		this.fCFID = fCFID;
	} 
	
	public void changeFCFIDWith(int fCFID){
		this.fCFID += fCFID;
	}
	
	public void changeFCFIDWithMin(int fCFID,int min){
		this.fCFID += fCFID;
		this.fCFID = this.fCFID < min ? min : this.fCFID;
	}
	
	public void changeFCFIDWithMax(int fCFID,int max){
		this.fCFID += fCFID;
		this.fCFID = this.fCFID > max ? max : this.fCFID;
	}
	
	public void changeFCFIDWithMaxMin(int fCFID,int max,int min){
		this.fCFID += fCFID;
		this.fCFID = this.fCFID < min ? min : this.fCFID;
		this.fCFID = this.fCFID > max ? max : this.fCFID;
	}	
	public String getNAME() {
		return nAME;
	}

	public void setNAME(String nAME) {
		this.nAME = nAME;
	} 
	
	public String getVALUE() {
		return vALUE;
	}

	public void setVALUE(String vALUE) {
		this.vALUE = vALUE;
	} 
	
	public String getCOLOR() {
		return cOLOR;
	}

	public void setCOLOR(String cOLOR) {
		this.cOLOR = cOLOR;
	} 
	
	public String getALPHA() {
		return aLPHA;
	}

	public void setALPHA(String aLPHA) {
		this.aLPHA = aLPHA;
	} 
	
	public String getISSLICED() {
		return iSSLICED;
	}

	public void setISSLICED(String iSSLICED) {
		this.iSSLICED = iSSLICED;
	} 
	
	public String getPRODUCT() {
		return pRODUCT;
	}

	public void setPRODUCT(String pRODUCT) {
		this.pRODUCT = pRODUCT;
	} 
	
	
	public Map ea_demo_fcfToMap() {
		Map map = new HashMap();
		try {
			map.put("fCFID",this.fCFID);
			map.put("nAME",this.nAME);
			map.put("vALUE",this.vALUE);
			map.put("cOLOR",this.cOLOR);
			map.put("aLPHA",this.aLPHA);
			map.put("iSSLICED",this.iSSLICED);
			map.put("pRODUCT",this.pRODUCT);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}

	public Ea_demo_fcf mapToEa_demo_fcf(Map map){
		try {
			int fCFID = Integer.parseInt( map.get("fCFID").toString());
			String nAME =  map.get("nAME").toString();
			String vALUE =  map.get("vALUE").toString();
			String cOLOR =  map.get("cOLOR").toString();
			String aLPHA =  map.get("aLPHA").toString();
			String iSSLICED =  map.get("iSSLICED").toString();
			String pRODUCT =  map.get("pRODUCT").toString();
			Ea_demo_fcf ea_demo_fcf = new Ea_demo_fcf(fCFID, nAME, vALUE, cOLOR, aLPHA, iSSLICED, pRODUCT);
			return ea_demo_fcf;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	} 
	
	public String toString(){
		return ea_demo_fcfToMap().toString();
	}
	
	//方便数据操作	
	public Ea_demo_fcf insert(){
		return DB.insert(this);
	}
}
